package org.jetlinks.protocol.official.mqtt.up;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.jetlinks.core.device.DeviceOperator;
import org.jetlinks.core.message.DeviceMessage;
import org.jetlinks.core.message.codec.MqttMessage;
import org.jetlinks.protocol.official.mqtt.up.radar60FL.Radar60FallDownUpHandler;
import org.jetlinks.protocol.official.mqtt.up.radar60SP.Radar60BreathSleepUpHandler;
import org.jetlinks.protocol.official.mqtt.up.zigbeeGateway.ZigbeeGatewayUpHandler;
import org.reactivestreams.Publisher;

import java.util.function.BiFunction;

/**
 * @Author bingzhong
 * @Date 2024/12/30 18:08
 * @Description
 */
@Getter
@AllArgsConstructor
public enum UpTopicMessageEnum {

    Radar60_Breath_Sleep("/Radar60SP", Radar60BreathSleepUpHandler::doDecode),
    ZigbeeGateway("gateway/out",ZigbeeGatewayUpHandler::doDecode),
    Radar60_Fall_Down("/Radar60FL", Radar60FallDownUpHandler::doDecode);

    private final String topicPrefix;

    private final BiFunction<MqttMessage, DeviceOperator, Publisher<DeviceMessage>> function;

}
